package com.chinatsp.onlineapp.presenter;

import com.chinatsp.onlineapp.base.Config;
import com.chinatsp.onlineapp.bean.ChannelList;
import com.chinatsp.onlineapp.bean.NewsList;
import com.google.gson.Gson;

import android.content.Context;
import tsp.cn.http.BaseIDao;
import tsp.cn.http.HttpConfig;
import tsp.cn.http.interfac.INetResult;
import tsp.cn.http.tools.LogUtil;
import tsp.cn.http.tools.T;

public class NewsChannelDao extends BaseIDao {
	ChannelList list;
	Context context;

	public NewsChannelDao(Context context, INetResult iNetResult) {
		super(context, iNetResult);
		this.context = context;
	}

	@Override
	public void onRequestSuccess(String result, int requestCode) {
		// LogUtil.v("---开始处理---"+result);
		// T.showShort(context, result);
		LogUtil.d( "NewsChannelDao onRequestSuccess");
		list = new Gson().fromJson(result, ChannelList.class);
	}

	public ChannelList getChannelList() {
		return this.list;
	}

	public void sendUrl() {
		StringBuilder strBuilder = new StringBuilder();
		strBuilder.append(HttpConfig.appendString());
		strBuilder.append(Config.API_NEWS_LIST);
		getRequest(strBuilder.toString(), Config.CODE_NEWS_LIST);
	}

}
